//
//  ViewController.m
//  UI_24_加密
//
//  Created by li cheng on 16/8/16.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "ViewController.h"
#import "NSString+LHLSHA_1.h"
#import "NSString+LCMD5.h"
#import "NSString+LHLBase64.h"
#import "NSString+LHLDES.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    //MD5 SHA-1 单项散列函数，算法
    //1.MD5 验证算法，一般用于验证密码
    NSString *afterMD5 = @"Hello, 12345678";
//    NSString *finakeMD5 = [afterMD5 stringWith32BitMD5Lower];
    NSString *final32BitLowerMD5 = [afterMD5 stringWith32BitMD5Lower];
    NSString *final32BitUpperMD5 = [afterMD5 stringWith32BitMD5Upper];
    NSString *final16BitLowerMD5 = [afterMD5 stringWith16BitMD5Lower];
    NSString *final16BitUpperMD5 = [afterMD5 stringWith16BitMD5Upper];

    NSLog(@"32bit 小写:%@",final32BitLowerMD5);
    NSLog(@"32bit 大写:%@",final32BitUpperMD5);
    NSLog(@"16bit 小写:%@",final16BitLowerMD5);
    NSLog(@"16bit 大写:%@",final16BitUpperMD5);
    //2.SHA-1
    NSString *afterSHA_1 = @"HELLO";
    NSString *finalSHA_1String = [afterSHA_1 stringWithSHA_1];
    NSLog(@"%@",finalSHA_1String);
    //3.Base64
    NSString *afterBase64 = @"Hello";
    NSString *base64 = [afterBase64 stringWithBase64];
    NSLog(@"base64:%@",base64);
    NSString *finalString = [base64 base64WithString];
    NSLog(@"%@",finalString);
    //4.对称密码
    //三种 算法 DES 3重DES AES
    NSString *string = @"123";
    NSString *desString = [string stringWithDES];
    NSLog(@"desString:%@,",desString);
    NSString *source = [desString desWithString];
    NSLog(@"source:%@",source);
    
    //
    //
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
